<?xml version="1.0" encoding="UTF-8"?>

<project name="Sniffy" default="py2sis" basedir="." xmlns:antsy="antlib:com.mwicat.antsymble">

	<property file="symbiant.properties" />

	<property name="src.dir" location="src" />
	<property name="lib.dir" location="src" />
	<property name="dist.dir" location="dist" />
	<property name="data.dir" location="data" />
	<property name="sis.dir" location="sis" />
	<property name="contrib.dir" location="contrib" />

	<property name="app.name" value="${ant.project.name}" />
	<property name="app.exec" value="${appname}_${uid}.exe" />
	<property name="app.caps" value="NetworkServices+LocalServices+ReadUserData+WriteUserData+Location+UserEnvironment" />

	
	<property name="py.src" location="${src.dir}/default.py" />

	<property name="profile" value="s60ui" />

	<property name="sis.name" value="${app.name}.sis" />

	<property name="script.dir" value="E:\data\python" />
	<property name="tmp.dir" value="E:\Others" />

	<property name="pys60.drive" value="E:" />
	<property name="install.drive" value="E:" />

	<property environment="env" />

	<property name="epoc.drive" value="t:" />
	<property name="epoc.root" value="${epoc.drive}${env.EPOCROOT}" />

	<echo>${ant.version}</echo>


	<taskdef resource="pyAntTasks.properties" />

	<target name="py2sis" depends="build">
		<antsy:py2sis src="${dist.dir}">
			<options>
				<arg value="--appname=${app.name}" />
				<arg value="--icon=${contrib.dir}/start-here.svgt" />
				<arg value="--caps=${app.caps}" />				
				<!--<arg value="-privkey=${privkey}" />
				<arg value="-cert=${cert}" />-->
				<arg value="--profile=${profile}" />
			</options>
			<args>
				<arg value="${sis.dir}/${sis.name}" />
			</args>
		</antsy:py2sis>
	</target>

	<target name="build">
		<delete dir="${dist.dir}" />
		<mkdir dir="${dist.dir}" />
		<copy todir="${dist.dir}">
			<fileset dir="${src.dir}" defaultexcludes="false">
				<exclude name="**/.svn/**" />
			</fileset>
		</copy>
	</target>


	<target name="upload">
		<antsy:upload host="${rpyc.host}" src="${sis.dir}/${sis.name}" dst="${tmp.dir}" />
	</target>

	<target name="upload-emu">
		<antsy:upload-emu root="${epoc.root}" src="${py.src}" />
	</target>

	<target name="upload-script">
		<antsy:upload-script host="${rpyc.host}" src="${py.src}" drive="${pys60.drive}" />
	</target>

	<target name="upload-script-emu">
		<antsy:upload-script-emu root="${epoc.root}" src="${py.src}" />
	</target>

	<target name="upload-data-emu">
		<antsy:upload-data-emu root="${epoc.root}" todir="sniffy" dir="${data.dir}" />
	</target>

	<target name="upload-lib-emu">
		<antsy:upload-lib-emu root="${epoc.root}" src="${src.dir}" />
	</target>

	<target name="upload-all-emu" depends="upload-emu,upload-data-emu,upload-script-emu,upload-lib-emu" />


	<target name="install">
		<antsy:install host="${rpyc.host}" path="${sis.dir}/${sis.name}" />
	</target>

	<target name="run">
		<antsy:run exec="${app.exec}" />
	</target>

	<target name="run-script">
		<antsy:run-script host="${rpyc.host}" drive="${pys60.drive}" name="${py.src}" />
	</target>


</project>
